<template>
    <div style="background-color: #ffffff;">
        <!-- :before-change="beforeChange" -->
        <HeadNav :title="'往期填报记录'"></HeadNav>
        <!-- 周月年 -->
        <div class="content">
            <div class="topBox">
                <div class="sort-menu">
                    <div :class="[current === index ? 'sort_option_selected ' : '', 'sort_option']"
                        v-for="(item, index) in tabList" :key="index" :id="index"
                        @click="changeSort(index, $event, item.typeName)">
                        <div class="couponSpanText">{{ item.typeName }}</div>
                        <div class="bottomLine" v-if="current === index"></div>
                    </div>
                </div>
            </div>
            <div class="recordList">
                <div class="recordItem" v-for="(item,index) in recordList" :key="index"  @click="tocheckedDetail(item)">
                    <!-- <view class="recordItem_bg"> -->
                        <div class="recordItemL">
                            <div class="recordItemL-left"><img :src="item.Icon" alt=""></div>
                            <div class="recordItemL-right">
                                <div class="recordItemL-right-text">{{ item.name }}</div>
                                <div class="recordItemL-right-text" style="margin-top: 8px;">{{ item.date }}</div>
                            </div>
                        </div>
                        <div class="recordItemR">
                            <div class="recordItemR-left">
                                <div class="recordItemR-left-num">共{{ item.allNum }}项产品</div>
                                <div class="recordItemR-left-price" style="margin-top: 8px;">合￥{{ item.allPrice }}</div>
                            </div>
                            <div class="recordItemR-right"><van-icon name="arrow" size='11' @click="tocheckedDetail(item)"/></div>
                        </div>
                    <!-- </view> -->
                </div>
            </div>
        </div>
        <foot></foot>
    </div>
</template>

<script>
/* eslint-disable */
import { getApplyCertificationPagePho, getVerifyTypeList } from '@/api/api'
import { getParams } from '@/common/public'
import HeadNav from '@/components/HeadNav'
import foot from '../foot/foot.vue'
import moment from 'moment'
import { mapState } from 'vuex'
import { Icon } from 'vant'
export default {
    name: 'FullInRecord',
    components: {
        HeadNav,
        foot
    },
    computed: {
        ...mapState({
            token: (state) => state.applyrecords.token
        })
    },
    watch: {
        active(newVal) {
            console.log('newVal', newVal)
            if (newVal === 0) {

            } else if (newVal === 0) {

            } else {

            }
        }
    },
    data() {
        return {
            active: 1,
            tabList: [
                {
                    typeId: 0,
                    typeName: '周'
                },
                {
                    typeId: 1,
                    typeName: '月'
                },
                {
                    typeId: 2,
                    typeName: '年'
                }
            ],
 
            current: 0,
            recordList:[
                {
                    id:1,
                    Icon: require('../../assets/images/recordIcon.png'),
                    name:'运中食堂第一档口',
                    date:'2024.01.26(周日)',
                    allNum:'5',
                    allPrice:'260.00'
                },
                {
                    id:1,
                    Icon: require('../../assets/images/recordIcon.png'),
                    name:'运中食堂第一档口',
                    date:'2024.01.25(周六)',
                    allNum:'5',
                    allPrice:'795.00'
                },
                {
                    id:1,
                    Icon: require('../../assets/images/recordIcon.png'),
                    name:'运中食堂第一档口',
                    date:'2024.01.26(周五)',
                    allNum:'5',
                    allPrice:'795.00'
                },
                {
                    id:1,
                    Icon: require('../../assets/images/recordIcon.png'),
                    name:'运中食堂第一档口',
                    date:'2024.01.26(周四)',
                    allNum:'5',
                    allPrice:'795.00'
                },
            ]
        }
    },
    mounted() {

    },
    created() {
      
    },
    methods: {
        toCheck() { },
        // 页面顶部的tab
        changeSort(index, e) {
            this.current = index
            console.log(index, e)
        },
        // 申报明细
        tocheckedDetail(item){
            this.$router.push({
                path: '/applyDetails',
                query: { item: JSON.stringify(item) }
            })
        }
    },
    beforeDestroy() {
        console.log('index')
        window.removeEventListener('scroll', this.onLoad, true)
    }
}
</script>

<style lang="less" scoped>
span,
p {
    padding: 0;
    margin: 0;
}

/deep/.van-tab {
    z-index: 200;
    height: 44px;
    //  background:rgb(216, 143, 143);
}

/deep/.van-tabs__wrap .van-tabs__wrap--scrollable {
    position: fixed;
}

/deep/.van-tab--active {
    /* color: rgb(255, 152, 82); */
}

/deep/.van-tabs__line {
    height: 0.6vw;
    background-color: rgb(255, 152, 82);
}

.content {
    overflow: hidden;
    margin-bottom: 10px;
    background: #ffffff;
}
.recordList{
    background: #f9f9f9;
    padding-bottom: 5px;
}
.recordItem{
    // padding: 24px;
    // display: flex;
    // align-items: center;
    // justify-content: space-between;
    background-color: #ffffff;
    padding-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    margin-bottom: 5px;

    .recordItem_bg{
        background: #f40b0b;
        padding: 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 300px;
    }

    .recordItemL{
        display: flex;
        align-items: center;
    }

    .recordItemL-left{
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        img{
            width: 22px;
            height: 22px;
        }
        
    }
    .recordItemL-right{
        display: flex;
        justify-content: center;
        flex-direction: column;
        margin-left: 12px;

        .recordItemL-right-text{
            font-size: 14px;
            color: #000000;
            text-align: left;
        }
    }

    .recordItemR{
        display: flex;
        align-items: center;
        .recordItemR-left{
            .recordItemR-left-num{
                color: #666666;
                font-size: 14px;
            }
            .recordItemR-left-price{
                color: #000000;
                font-size: 14px;
            }
        }


        .recordItemR-right{
            margin-left: 12px;
        }
    }
}
.recordItem:last-child{
    margin-bottom: 0px;
}


.topBox {
    margin-top: 44px;
    margin-bottom: 12px;
    padding-left: 24px;
    padding-right: 24px;
    width: calc(100% - 48px);
    background-color: #f9f9f9;
    height: 48px;

    // 全部分类  menu
    .sort-menu {
        width: 100%;
        height: 48px;
        line-height: 48px;
        justify-content: space-around;
        align-items: center;
        text-align: center;
        vertical-align: middle;

        .sort_option {
            font-size: 18px;
            height: 26px;
            line-height: 26px;
            cursor: pointer;
            display: inline-block;
            flex-direction: column;
            align-items: center;
            color: #666666;
            padding: 0px 35px 0px;
        }

        .sort_option_selected {
            font-weight: bolder;
            line-height: 18px;
            font-size: 18px;
            color: #000000;
            padding: 0px 35px 0px;
        }

        .bottomLine {
            height: 2px;
            background-color: #047DCB;
            border-radius: 2px;
            margin-top: 10px;
            text-align: center;

        }

    }

    // // 按钮公用样式
    //     .item_option {
    //       line-height: 14px;
    //       font-size: 14px;
    //       text-align: left;
    //       color: #666666;
    //     }

    //     .item_option_selected {
    //       // font-weight: 900;
    //       font-weight: bolder;
    //       text-align: left;
    //       color: #111111;
    //     }


}

/*清浮动*/
.clearfix:after {
    content: '';
    display: block;
    clear: both;
}

.clearfix {
    zoom: 1;
}



/deep/.van-tabs__wrap {
    touch-action: manipulation;
    border-top: none;
}

/deep/.van-tab {
    border-top: none;
    border-bottom: 1px solid rgba(245, 244, 249, 1);
}



// 去逛逛
.loginBtn {
    width: 100%;
    height: 45px;
    border: none;
    background: #047DCB;
    border-radius: 45px;
}

.tips {
    margin-top: 25px;
    font-size: 14px;
    text-align: right;
    color: #000000;
    line-height: 14px;
}
</style>